//
//  movieTableViewCell.m
//  timemovie
//
//  Created by Yiqiao on 15/7/20.
//  Copyright (c) 2015年 Yiqiao. All rights reserved.
//

#import "movieTableViewCell.h"
#import "UIImageView+WebCache.h"
#import "common.h"
@implementation movieTableViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self  = [super initWithStyle:style reuseIdentifier: reuseIdentifier];
    if (self) {
    }
    return self;
    
}

- (void)awakeFromNib {
    
    _titleView.text = _model.title;
    _yearView.text = _model.year;
   
}

- (void)setModel:(MObj *)model{
    _model = model;
    _STAR.average = _model.average;
    [self setNeedsLayout];
    
}

- (void)layoutSubviews{
    [super layoutSubviews];
    _titleView.text = _model.title;
    _titleView.textColor = [UIColor orangeColor];
    _yearView.text = [NSString stringWithFormat:@"Year: %@", _model.year] ;
    _score.text = [NSString stringWithFormat:@"%0.1f",_model.average];
    [_iconImage sd_setImageWithURL:[NSURL URLWithString:[_model.images objectForKey:@"medium" ]]];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
